#include <stdio.h>
#include <unistd.h>
#include <signal.h>

void sigcallback(int sig)
{
    printf("sig : %d\n", sig);
}

int main()
{
    //signal(2, sigcallback);


    sigset_t set, oldset;
    sigemptyset(&set);
    sigemptyset(&oldset);

    //set 000000000000全0
    //oldset 00000000000全0
    
    //将sigset_t类型的变量全部置位1
    sigfillset(&set);
    //全阻塞
    sigprocmask(SIG_BLOCK, &set, &oldset);
    printf("signal block\n");
    sleep(2);
    getchar();
    //全非阻塞
    sigprocmask(SIG_UNBLOCK, &set, NULL);

    while(1)
    {
        printf("signal unblock\n");
        sleep(2);
    }
    return 0;
}
